<template>
    <div>
        <el-button type="primary" @click="qq()">主要按钮</el-button>

        <el-table :data="res" style="width: 100%">
            <el-table-column prop="course_name" label="课程名称" width="180"></el-table-column>
            <el-table-column prop="course_define" label="课程简介" width="600"></el-table-column>
            <el-table-column prop="course_year" label="学年"></el-table-column>
            <el-table-column prop="course_term" label="学期"></el-table-column>
            <el-table-column prop="course_intake" label="学生人数"></el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <!-- <el-button size="small" type="danger" @click="del(scope.row)"
            >删除</el-button
                    >-->
                    <button type="button" class="btn btn-primary btn-danger" data-toggle="modal" data-target="#myModalsc">删除</button>
                    <div class="modal fade" id="myModalsc" ref="myModalsc">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal">
                                        <span aria-hidden="true">×</span>
                                        <span class="sr-only">关闭</span>
                                    </button>
                                    <h4 class="modal-title" style="font-size: 18px">提示</h4>
                                </div>
                                <div class="modal-body">
                                    <p style="font-size: 16px">
                                        <i class="el-icon-warning" style="color: red"></i>此操作将永久删除该文件, 是否继续?
                                    </p>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <button type="button" class="btn btn-primary" @click="del(scope.row)">确定</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" @click="initInfo(scope.row)">编辑</button>
                    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal" @click="classgo(scope.row)">进入班级</button>
                </template>
            </el-table-column>
        </el-table>

        <el-button type="primary" @click="ww()">主要按钮</el-button>
        <el-table :data="infos" style="width: 100%">
            <el-table-column prop="class_name" label="姓名" width="180"></el-table-column>
            <el-table-column prop="course_year" label="地址"></el-table-column>
            <el-table-column prop="course_term" label="地址"></el-table-column>
            <el-table-column prop="course_intake" label="地址"></el-table-column>
        </el-table>
    </div>
</template>
<script>
export default {
    data() {
        return {
            res: [],
            infos: [],
            from: {
                teacher_id: '200001'
            },
            sea: {
                course_id: '1037'
            }
        }
    },
    created() {},
    computed: {},
    methods: {
        qq() {
            console.log(this.from)
            this.$axios
                .post('http://10.197.26.58:8080/TeacherCourse', this.from)
                .then(response => {
                    this.res = response.data.body
                    console.log(this.res)
                })
        },
        ww() {
            console.log(this.from)
            this.$axios
                .post('http://10.197.26.58:8080/searchClass', this.sea)
                .then(response => {
                    this.infos = response.data.body
                    console.log(this.infos)
                })
        },
        classgo() {
            this.$axios
                .post('http://10.197.26.58:8080/searchClass', this.sea)
                .then(response => {
                    this.infos = response.data.body
                    console.log(this.infos)
                })
        }
    },
    mounted() {}
}
</script>
<style scoped></style>
